package com.xiaozhi.dao;
/*
 *  先将token 存在数据库里 后续优化到redis
 */

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.xiaozhi.vo.UserTokenVO;

public interface UserTokenMapper {
	@Select("select * from user_token where token = #{token}")
	UserTokenVO getUserFromToken(String token);

	@Insert({"insert into user_token (userId,openId,token)",
			"values (#{userId},#{openId},#{token})"})
	void addUserTokenVO(UserTokenVO vo);
	@Update("update user_token set userId=#{userId},token=#{token} where openId=#{openId}")
	void update(UserTokenVO vo);
}
